package design.pattern.singleton.lazy;

/**
 * @description: 懒汉式单例 -- 双重校验
 * @author: liuzhangcheng
 **/
public class LazyDoubleCheckSingletonTest {
    public static void main(String[] args) {
        Runnable runnable = ()->{
            LazyDoubleCheckSingleton singleton = LazyDoubleCheckSingleton.getInstance();
            System.out.println(Thread.currentThread().getName() + ":" + singleton);
        };

        Thread t1 = new Thread(runnable);
        Thread t2 = new Thread(runnable);

        t1.start();
        t2.start();
    }
}
